/* RMI-C Client : Echo Sample (v1) */

#include "rmi.h"
#include "echo.h"

/* ************************ CLIENT ************************ */

int main(int argc, char* argv[])
{
  char * hostname = argv[1];
  int port = atoi(argv[2]);

  CLIENT * client = rmi_client_create(hostname, port, __echo__, 1);

  /* test 1 */
  char * msg = NULL;
  echo_hello(client, NULL, &msg);
  printf("msg = %s\n", msg);

  /* test 2 */
  echo_goodbye(client, NULL, NULL);

  /* test 3 */
  struct two_int_t xy; 
  xy.x = 10; xy.y = 1;
  int sum = 0;
  echo_sum(client, &xy, &sum);
  printf("x=%d, y=%d, sum=%d\n", xy.x, xy.y, sum);

  rmi_client_destroy(client);

  return EXIT_SUCCESS;
}
